# $Id: PKGBUILD 83191 2013-01-27 20:19:44Z pierre $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Giorgio Lando <patroclo7@gmail.com>
# Contributor: Nicolas Quienot <niQo@aur>
# Contributor: Jesse Young <jesse.young@gmail.com>

pkgbase=python2-httplib2
pkgname=(python-httplib2 python2-httplib2)
_pkgbasename=httplib2
pkgver=0.7.7
pkgrel=1
pkgdesc="A comprehensive HTTP client library, supporting many features"
url="http://code.google.com/p/httplib2/"
license=('MIT')
arch=('any')
makedepends=('python' 'python2')
provides=('httplib2')
replaces=('httplib2')
source=(http://httplib2.googlecode.com/files/${_pkgbasename}-${pkgver}.tar.gz
        COPYING)
sha1sums=('6c5b748676518e1162a10f1c3c63ca960a30a7a0'
          'fada4b38c7b9354de71ce80b014a313a4363c7dc')

build() {
  cd "${srcdir}"
  cp -a "${_pkgbasename}-${pkgver}" "${pkgname[0]}-$pkgver"
  cp -a "${_pkgbasename}-${pkgver}" "${pkgname[1]}-$pkgver"
}

package_python-httplib2() {
  depends=('python')

  cd "${srcdir}/${pkgname}-${pkgver}"
  python setup.py install --root="${pkgdir}"
  install -D -m644 "${srcdir}/COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_python2-httplib2() {
  depends=('python2')

  cd "${srcdir}/${pkgname}-${pkgver}"
  python2 setup.py install --root="${pkgdir}"
  install -D -m644 "${srcdir}/COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
